package com.songlanyun.modules.information.model.dto;

import com.songlanyun.common.drive.ValueObject;
import com.songlanyun.common.validator.group.AddGroup;
import com.songlanyun.common.validator.group.UpdateGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 资讯分类
 *
 * @author WuChao
 * @email songlanyun@gmail.com
 * @date 2022-11-18 09:52:58
 */
@Data
public class InformationClassifyDto implements ValueObject {

    /**
     *
     */
    @NotNull(message = "ID不能为空", groups = UpdateGroup.class)
    private Long id;
    /**
     * 名称
     */
    @NotBlank(message = "分类名称不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Length(max = 100, message = "分类名称的长度不能超过100个字", groups = {AddGroup.class, UpdateGroup.class})
    private String name;
    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private Integer sort;

}
